<template>
  <div v-show="visible" class="my-card-box" @click="close">
    <div class="my-card" @click="stop">
      <div class="card-head">企业详情</div>
      <div class="card-body">
        <iframe
          frameborder="0"
          :src="iframeSrc"
          allowfullscreen="true"
          width="100%"
          height="800px"
          style="overflow: hidden"
        >
        </iframe>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      iframeSrc: ''
    };
  },
  methods: {
    close() {
      this.visible = false;
    },
    stop(e) {
      e.stopPropagation(); // 阻止事件冒泡即可
    },
    showRelation(item) {
      this.iframeSrc = `${this.domainName}:8879//#/enterpriseDetails?corpKey=${item}`;
      console.log(this.iframeSrc, 'this.iframeSrc');
      this.visible = true;
    }
  }
};
</script>

<style lang="scss" scoped>
.my-card-box {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 100;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  .my-card {
    width: 520px;
    height: 800px;
    margin: 120px auto 0;
    .card-head {
      background-image: url(~img/card_header.png);
      background-repeat: no-repeat;
      background-size: cover;
      width: 382px;
      height: 45px;
      margin: 0 auto;
      position: relative;
      top: 20px;
      color: #d7f4ff;
      font-size: 22px;
      font-family: YouSheBiaoTiHei;
      text-align: center;
      line-height: 50px;
      z-index: 100;
    }
    .card-body {
      // background: rgba(2, 47, 131, 0.95);
      height: 760px;
      // box-shadow: 1px 1px 20px 3px rgba(0, 100, 199, 0.6) inset,
      //   -1px -1px 20px 3px rgba(0, 100, 199, 0.6) inset;
      background: #fff;
      opacity: 0.96;
      padding: 30px;
      padding-top: 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .buttons {
        display: flex;
        margin-top: 0px;
        margin-bottom: 0px;
        .button {
          width: 130px;
          height: 35px;
          color: #2a7ef3;
          font-size: 14px;
          border: 1px solid #1d71e6;
          text-align: center;
          line-height: 46px;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
          img {
            width: 20px;
            margin-right: 5px;
          }
        }
        .button2 {
          img {
            width: 18px;
            margin-right: 5px;
          }
        }
        .button:first-child {
          border-top-left-radius: 8px;
          border-bottom-left-radius: 8px;
        }
        .button:last-child {
          border-top-right-radius: 8px;
          border-bottom-right-radius: 8px;
        }
        .active-button {
          color: #d7f4ff;
          background: #1d71e6;
        }
      }
      #chart-company {
        width: 1020px;
        height: 650px;
      }
    }
  }
}
</style>
